import { request } from '@/request'

export const getComplaintList = <T extends object, R = any>(
  data: T
): Promise<IResponse<IList<R>>> => {
  return request.GET<T>({ url: '/complaints/list', params: data })
}

export const editComplaint = <T extends object, R = any>(
  data: T
): Promise<IResponse<R>> => {
  return request.POST<T>({ url: '/complaints/update', params: data })
}

export const addComplaint = <T extends object, R = any>(
  data: T
): Promise<IResponse<R>> => {
  return request.POST<T>({ url: '/complaints/add', params: data })
}
